/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Message;

import Core.IMessageHandler;
import Core.MessageBuilder;
import Core.StringUtil;

/**
 *
 * @author Mr Bao
 */
public class LogInResultMessageHandler implements IMessageHandler {

    public Object Process(String message) {
        int idx = message.indexOf(MessageBuilder.ONE);
        String tmp = message.substring(idx + 1);
        String[] content = StringUtil.Split(tmp, MessageBuilder.TWO.charAt(0));
        String error = content[0];
        long userId = Long.parseLong(content[1].trim());
        LogInResultMessage r = new LogInResultMessage(error, userId);
        return r;
    }
}
